home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-30 | 3.8 KB | 138 lines | [TEXT/MPS ] |
- //
- // setupFunScript.r
- //
- // This example demonstrates usage of the Preference resource ('inpr') to
- // call a Setup Function. The Setup Function in this example searches
- // for the first copy of the SimpleText (or TeachText) application found
- // on the default target volume. If a copy of the application is found,
- // the FSSpec of its parent folder is returned to the Installer and is
- // displayed as the recommended target folder to install our Example File into.
- //
- // If the user clicks Install without selecting a different target folder,
- // a Example File will be installed to the folder suggested by the Setup
- // Function. Otherwise, the Example File is installed into the user-selected
- // folder.
- //
- // NOTE: This example uses pre-4.0 method for creating Custom Install options.
- // It is not intended as an example of how to use 4.0 User Interface features.
- // (See the "Custom UI Example" for an example of the 4.0 Interface features.)
- //
- // Copyright 1993-1996, Apple Computer, Inc., All Rights Reserved
- //
-
- include "SetupFunction"; // our Setup Function code resource
-
- #include "InstallerTypes.r"
-
-
- /************************** Target File Spec. resources **********************************/
- // target file spec for Example File
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator than those specified
- // below will not be replaced.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- 'ttro', // TYPE for new file
- 'ttxt', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- "folder-user:Example File"
- }
- };
-
- /************************** Source File Spec. resources **********************************/
- resource 'infs' (20000) {
- 'ttro',
- 'ttxt',
- 0x1,
- noSearchForFile,
- TypeCrMustMatch,
- "Tidbits:Example File"
- };
-
- /************************** File Atom resource **********************************/
- resource 'infa' (10000) {
- format1 {
- deleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- dontIgnoreLockedFile,
- dontSetFileLocked,
- useVersProcToCompare,
- srcNeedExist,
- rsrcForkInRsrcFork,
- leaveAloneIfNewer,
- updateExisting,
- copyIfNewOrUpdate,
- rsrcFork,
- dataFork,
- 0,
- 0,
- 10000,
- { 20000, 0, 0
- },
- 0x0,
- 0,
- 0,
- ""
- }
- };
-
- /************************** Package resource **********************************/
- resource 'inpk' (20037) {
- format0 {
- showsOnCustom,
- notRemovable,
- dontForceRestart,
- 0,
- 0,
- "Example File",
- {
- 'infa', 10000,
- }
- }
- };
-
- /************************** Preference resource **********************************/
- resource 'inpr' (300) {
- format0 {
- useFolderTargetMode, // Tells the Installer which interface to use,
- // either disk based or folder based
-
- dontAllowUserToSetSystemDisk, // Restricts user from changing System Disk
- showSelectedSizeInCustom,
- setupFunctionSupplied, // Tells Installer to call Setup Function
- dontAllowCleanInstall,
- dontAllowServerAsTarget,
- 'infn', // Setup Function code resource type
- 147, // Setup Function code resource ID
- { /* array helpPagelist: 2 elements */
- /* [1] */ 301, 311, 301, 311,
- /* [2] */ 302, 312, 302, 312
- },
- "Demo Install Folder" // Default Target Folder name
- } // used if user creates a New folder...
- };
-
-
-
-
-